package com.dyp.mvc.swagger.ctr;

import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/self")
public class SelfDefineRestfulCtr {
    @GetMapping(value = "ping", produces = "application/json;charset=UTF-8")
    public ModelMap test() {
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        ModelMap map = new ModelMap();
        map.addAttribute("code", "200");
        map.addAttribute("desc", "it works");

        return map;
    }
}
